const fs = require("fs")

const file_url = `${__dirname}/../utils/util.js`
const content = fs.readFileSync(file_url, 'utf8');
const paramList = process.argv.splice(2)

function develop(str) {
  return str.replace("const envVersion = \"trial\"", "const envVersion = \"develop\"")
}

function trial(str) {
  return str.replace("const envVersion = \"develop\"", "const envVersion = \"trial\"")
}

const contentNew = paramList[0] == 'dev' ? develop(content) : trial(content)

fs.writeFileSync(file_url, contentNew);


console.log(process.env.npm_package_name);
